<?php 
    $module = $this->uri->segment(1);
    foreach($car_list_pending->result() as $row)
    { 
?>
        <div  class= "modelItem">
            <img width="112px" height="84px" src="<?php echo base_url()?>system/public/assets/cars/<?php echo $row->image ?>" />
            <span class="msrpRange">
<?php 
            if(strtoupper($module) != 'RENT')
            {
                echo "$" . $row->car_price;
            }
?>
            </span> 
            <p class="configLink">
<?php 
                echo anchor(
                    "index.php/" . $module . "/detail/" . $row->id, 
                    $row->car_serie . " " . $row->car_make . " " . $row->car_model);                        
?>
            </p>
            <div class="mpgRange">
<?php 
                echo "Car category: " . $row->car_category;
                echo ", type: " . $row->car_type;
                echo ", external color: " . $row->external_color;
                echo ", internal color: " . $row->internal_color;
                echo ", door: " . $row->door_count;

                switch ($row->drive_train)
                {
                    case 1:
                        echo ", drive train: 2WD";
                        break;
                    case 2:
                        echo ", drive train: 4WD";
                        break;
                    case 3:
                        echo ", drive train: FWD";
                        break;
                    case 4:
                        echo ", drive train: RWD";
                        break;
                    case 5:
                        echo ", drive train: Others";
                        break;
                }

                switch ($row->transmission)
                {
                    case 1:
                        echo ", transmission: Manual";
                        break;
                    case 2:
                        echo ", transmission: Automatic";
                        break;
                    case 3:
                        echo ", transmission: Auto/manual";
                        break;
                    case 4:
                        echo ", transmission: Others";
                        break;
                }

                switch ($row->fuel)
                {
                    case 1:
                        echo ", fuel: Gasolin";
                        break;
                    case 2:
                        echo ", fuel: Diesel";
                        break;
                }

                if($row->vehicle_type != null)
                {
                    echo ", for: ";
                    $vehicle_type_list = preg_split('/,/', $row->vehicle_type, -1, PREG_SPLIT_OFFSET_CAPTURE);
                    foreach($vehicle_type_list as $vehicle_type)
                    {
                        switch($vehicle_type[0])
                        {
                            case "0":
                                echo "Rent. ";
                                break;
                            case "1":
                                echo "Sell. ";
                                break;
                            case "2":
                                echo "Buy. ";                                        
                                break;
                        }

                    }
                }                        
?>
            </div> 
<!--            
            <div class="mpgRange">
<?php 
                //echo $row->description;
?>
            </div>
-->
            <div class="mpgRange">
<?php 
                echo "<strong>Dealer: </strong>" . $row->dealer_name;
                echo ", " . $row->company_phone_1 . ", " . $row->email;
?>
            </div>
        </div>
<?php
    }
?>            